package com.zb.select.controller;

import com.zb.entity.SelectVo;
import com.zb.result.Result;
import com.zb.service.ZjFactoryService;
import com.zb.utils.TokenUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * @Author WEN
 * @Date 2024/4/1 0001
 **/
@Api(tags = "品牌商家下拉类接口")
@RestController
@RequestMapping("/factory/select")
public class FactorySelectController {
    @Resource
    private ZjFactoryService factoryService;

    @ApiOperation("获取品牌商家下拉数据")
    @PostMapping("/getFactorySelectPage")
    public Result getFactorySelectPage(HttpServletRequest request, @RequestBody @ApiParam(value = "品牌商家名称") SelectVo selectVo) {
        Long custAccId = TokenUtil.getcustAccIdByToken(request);
        return Result.success("获取品牌商家下拉数据成功").data(factoryService.getFactorySelectPage(custAccId, selectVo));
    }
}
